<?php 

/**
* 首页控制器
*/
class IndexController extends Controller
{
	
	//Index方法
	public function IndexAction()
	{
		$sql = "select * from message";

		$data = M()->queryAll($sql);

		$title = "这个是留言板首页";
		// 分配变量
		$this->assign('notice','小样，你妈叫你吃饭了');
		$this->assign('title',$title);
		$this->assign('data',$data);

		//引入模板
		$this->display();
	}

	public function SearchAction()
	{
		$this->display();
	}

	public function DeleteAction()
	{
		$id = $_GET['id'];

		$sql = "delete from message where id ='{$id}'";

		$c = M()->exec($sql);
		if($c){
			echo '成功';
		}
	}


	


}
















 ?>